#pragma once
#ifndef LIT__EDITOR__MOUSE__INCLUDED__HH__
#define LIT__EDITOR__MOUSE__INCLUDED__HH__

#include <LitEditorPrerequisites.h>
#include <qrect.h>
#include <qapplication.h>

namespace Lit
{
	namespace Editor
	{
		struct LIT_API DragInfos
		{
		protected:
			Vec2 mStart;
			Vec2 mEnd;
			bool mDrag;
			Qt::MouseButtons mButtons;

		public:
			DragInfos();
			~DragInfos();

			bool hasButton( Qt::MouseButton btn ) const;
			const Qt::MouseButtons& getButtons() const;

			const Vec2 &getStart() const;
			const Vec2 &getEnd() const;
			
			Vec2 start( Qt::MouseButtons btns = QApplication::mouseButtons() );

			// single step function
			// e.g inside loops etc
			//! returns: current delta
			Vec2 step();
			Vec2 stop();

			bool isDragging() const;

			Vec2 getDelta( Real factor = 1.0f ) const;
			QRect getGeometry() const;
		};
	};
};

#endif